#!/usr/bin/env python
#-*- coding:gbk -*-
u'''
@file commandhistoryfilter.py
@brief filter command history, reverse the command history and delete duplicate command.
@author hulei
@version 1.0
@date 2013-05-19
@copyright Copyright(C) 2013 Feitian Technologies Co., Ltd. All rights reserved.
'''

import sys,os

lines = map(lambda i: i.strip(), sys.stdin.readlines())
lines.reverse()
out = []
for line in lines:
    if line and line not in out:
        out.append(line)

for line in out:
    print line
